#include <linux/bug.h>			/* For BUG_ON.  */
#include <linux/init.h> /* Needed for the macros */
#include <linux/kernel.h> /* Needed for pr_info() */
#include <linux/module.h>
#include <linux/slab.h>


#define  TRUE(condition)  BUG_ON(!(condition))


struct  struct01 {
	int  num;
	int  timeout;
} ;


static int __init foo_init(void)
{
	int  aaa[10];
	struct  struct01 s2[] = {
			{196,1},{2,2}

	};


int  flag=0x01;
unsigned long  key=0x1110;

pr_info("num: %d\n", s2[0].num);
pr_info("num: %d\n", s2[1].num);

pr_info("num: %d\n", s2->num);


pr_info("key = 0x%x\n", (int)key);
set_bit(flag,&key);
pr_info("key = 0x%x\n", (int)key);
TRUE(key==0x1112);
TRUE(test_bit(flag,&key));

clear_bit(flag,&key);
pr_info("key = 0x%x\n", (int)key);
TRUE(key==0x1110);

  flag=0x04;
  set_bit(flag,&key);
  pr_info("key = 0x%x\n", (int)key);
  TRUE(key==(0x1110));
  TRUE(test_bit(flag,&key));

  flag=0x03;
  set_bit(flag,&key);
  pr_info("key = 0x%x\n", (int)key);
  TRUE(key==(0x1118));
  clear_bit(flag,&key);
  TRUE(!test_bit(flag,&key));
  TRUE(key==(0x1110));

  flag=0x04;
  clear_bit(flag,&key);
  TRUE(key==(0x1100));
  TRUE(!test_bit(flag,&key));

  TRUE(key==(0x1100));
  flag = 0x08;
  change_bit(flag,&key);
  TRUE(key==(0x1000));


pr_info("key = 0x%x\n", (int)key);



//aaa =  kmalloc(sizeof(int),GFP_KERNEL);
//
//
//*aaa =  10;

aaa[0]=14;
aaa[1]=15;

pr_info("a = %d\n", *aaa);
pr_info("a = %d\n", *(aaa+1));




return  0;
}

static void __exit foo_cleanup(void)
{



}

module_init(foo_init);
module_exit(foo_cleanup);

MODULE_LICENSE("GPL v2");
MODULE_AUTHOR("Andy");
MODULE_DESCRIPTION("andy one-key driver");
MODULE_ALIAS("one-key");
